{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
	.btn-primary{
		border-radius: 5px;
	}
	 .btn-primary:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 .btn-primary {
    color: #fff;
    background-color: #409eff;
    border-color: #409eff;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
  }
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
   
    统计中心
    <span class="c-gray en">&gt;</span>
    代理统计
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav> 
  
  <div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
<div style="margin-right: 2%;margin-top: 1.25%;margin-bottom: 1%;float:right;width:100%">
  <form action="/admin/statistics/agentStatistics" method="post" enctype="application/x-www-form-urlencoded" class="l" style="margin-left:60px;float:left;">
     时间：<input type="text" name="sDate1" value="{:input('sDate1')}" id="sDate1" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  class="input-text Wdate" style="width:120px;border-radius: 5px;">
       到：
      <input type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" name="sDate2" value="{:input('sDate2')}" id="sDate2"  class="input-text Wdate" style="width:120px;margin-right:15px;border-radius: 5px;">
    <input type="text" name="us_sql" id="us_sql" placeholder="账号" style="width:250px;margin-right: 30px;" class="input-text" value="{$username}">
   
    <button class="btn btn-success" type="submit" onclick="search()"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    
  </form>

					<a class="btn btn-primary radius" href="{:url('statistics/excelList')}?sure=1" style="float:right">
						
						导出EXCEL表格
					</a> 
				</div>
     <div class="page-container dataTables_wrapper">
      <div id="tab-system" class="HuiTab">
        <div class="tabCon">
          <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
                  <th>代理商</th>
                  <th>佣金返点</th>
                  <th>上级代理</th>
                  <th>上级佣金返点</th>
                  <th>账户余额</th>
                  <th>系属会员总数</th>
				  <th>系属佣金</th>
                  <th>直属会员总数</th>
                  <th>直属佣金</th>
                  <th>直属存款会员数</th>
                  <th>直属存款总额</th>
                  <th>直属取款总额</th>
                  <th>直属总投注</th>
                  <th>直属总派彩</th>
                  <th>盈亏情况 [投注金额-中奖金额]</th>
                  <th>杀率(%) [(投注金额-中奖金额)/投注金额]</th>
                </tr>
              </thead>
		      {foreach($list as $v)}
              <tbody>
                <tr class="text-c">
					<td>
					<a style="text-decoration:underline" class="ml-5" onclick="checklist('代理下级详情','/admin/member/hierarchyDiagram.html?yhid={$v.id}&url=bet',1200)" href="javascript:;">
					{$v.username}</a></td>
					<td>{$v.fandian}</td>
					<td>{$v.tjr}</td>
					<td>{$v.dlfandian}</td>
					<td>{$v.je}</td>
					<td>{$v.xszs}</td>
					<td>{$v.xsyj|default=0}</td>
					<td>{$v.xjrens}</td>
					<td>{$v.zshyrs.4}</td>
					<td>{$v.zshyrs.1}</td>
					<td>{$v.zshyrs.0}</td>
					<td>{$v.zshyrs.2}</td>
					<td>{$v.zshyrs.3}</td>
					<td>{$v.zshyrs.5}</td>
					<td>{$v.zshyrs.6}</td>
					<td>{$v.zshyrs.7}</td>
                </tr>
		      {/foreach}
		       <tr class="text-c">
                	<td>总计</td>
					
					<td>{$total.fandian}</td>
					<td></td>
					<td>{$total.dlfandian}</td>
					<td>{$total.je}</td>
					<td>{$total.xszs}</td>
					<td>{$total.xsyj}</td>
					<td>{$total.xjrens}</td>
					<td>{$total.zshyrs.4}</td>
					<td>{$total.zshyrs.1}</td>
					<td>{$total.zshyrs.0}</td>
					<td>{$total.zshyrs.2}</td>
					<td>{$total.zshyrs.3}</td>
					<td>{$total.zshyrs.5}</td>
					<td data="{$total.ykqk}" class="all_td"></td>
					<td>{$total.sl}</td>
                </tr>
              </tbody>
              
            </table>
             <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
             			<div style="float:left;">  
				          每页显示<select name="limit" style="height:26px;" id="code">
				          		<option value="20" {if condition="$limit eq 20"}selected{/if}>
                20
              </option>
              <option value="50" {if condition="$limit eq 50"}selected{/if}>
                50
              </option>
              <option value="100" {if condition="$limit eq 100"}selected{/if}>
                100
              </option>
				              
				              
				           </select>页
				          </div>
                        <span style="float:right;margin-left:-2px;">总共{$list->lastPage()}页  当前第{$list->currentPage()}页 ，共{$list->total()}条</span>
                        <div style="float:left;">{$list->render()}</div>
                    </div>
          </div>
        </div>
      </div>

    </div>
    </div>

    </div>
{/block}{block name="js"}
<script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript">
/*查看代理详情*/
function checklist(title,url,w,h){
	layer_show(title,url,w,h);
}
    $(function() {
	  $('.skin-minimal input').iCheck({
	    checkboxClass : 'icheckbox-blue',
	    radioClass : 'iradio-blue',
	    increaseArea : '20%'
	  });
	  $("#tab-system").Huitab({
	    index : 0
	  });
});
var allTd=document.getElementsByClassName('all_td')
for(var i=0;i<allTd.length;i++){
var str_td=parseFloat(allTd[i].getAttribute('data'))
   var str_td_two=str_td.toFixed(2)
	allTd[i].innerHTML=str_td_two
}
$(function(){
var username=$("#us_sql").val();
var id = $("#code").find('option:selected').val();
var li=$(".am-pagination").children();
  for (i = 0; i < li.length; i++) {
        
        var url=li.eq(i).attr('href');
        if(url){
          li.eq(i).attr('href',url+'&&us_sql='+username+"&&limit="+id);
        }       
    }
  
})
$("#code").on('change',function(){
    var username=$("#us_sql").val();  
    var id = $(this).find('option:selected').val();
    window.location.href="/admin/statistics/agentStatistics?us_sql="+username+"&&limit="+id;
  })
</script>

{/block}
